package com.spi.soconversion.orders;

import java.sql.Timestamp;

import com.spi.soconversion.util.SOCConstants;

public class SOCInstallBaseWarranty {

	private Timestamp warrantyStartDate;
	private Timestamp warrantyEndDate;
	private String warrantyPrice;
	private String warrantyStatus;
	private String warrantySKU;
	private String warrantyDescription;
	
	public String getWarrantyDescription() {
		return warrantyDescription;
	}
	
	public void setWarrantyDescription(String warrantyDescription) {
		this.warrantyDescription = warrantyDescription;
	}
	
	public String getWarrantySKU() {
		return warrantySKU;
	}
	
	public void setWarrantySKU(String warrantySKU) {
		this.warrantySKU = warrantySKU;
	}
		
	public String getWarrantyStatus() {
		return warrantyStatus;
	}
		
	public void setWarrantyStatus(String warrantyStatus) {
		this.warrantyStatus = warrantyStatus;
	}
		
	public String getWarrantyPrice() {
		return warrantyPrice;
	}
	
	public void setWarrantyPrice(String warrantyPrice) {
		this.warrantyPrice = warrantyPrice;
	}
	
	public Timestamp getWarrantyStartDate() {
		return warrantyStartDate;
	}
	
	public void setWarrantyStartDate(Timestamp warrantyStartDate) {
		this.warrantyStartDate = warrantyStartDate;
	}
	
	public void setWarrantyEndDate(Timestamp warrantyEndDate) {
		this.warrantyEndDate = warrantyEndDate;
	}
		
	public Timestamp getWarrantyEndDate() {
		return warrantyEndDate;
	}
	
	@Override
	public int hashCode() {
		final int prime = 35;
		int result = 1;
		result = prime * result + ((warrantyStartDate == null) ? 0 : warrantyStartDate.hashCode());
		result = prime * result + ((warrantyEndDate == null) ? 0 : warrantyEndDate.hashCode());
		result = prime * result + ((warrantyStatus == null) ? 0 : warrantyStatus.hashCode());
		result = prime * result	+ ((warrantyDescription == null) ? 0 : warrantyDescription.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		SOCInstallBaseWarranty other = (SOCInstallBaseWarranty) obj;
		if (warrantyStartDate == null) {
			if (other.warrantyStartDate != null)
				return false;
		} else if (!warrantyStartDate.equals(other.warrantyStartDate))
			return false;
		if (warrantyEndDate == null) {
			if (other.warrantyEndDate != null)
				return false;
		} else if (!warrantyEndDate.equals(other.warrantyEndDate))
			return false;
		
		if (warrantyStatus == null) {
			if (other.warrantyStatus != null)
				return false;
		} else if (!warrantyStatus.equals(other.warrantyStatus))
			return false;	
		if (warrantyDescription == null) {
			if (other.warrantyDescription != null)
				return false;
		} else if (!warrantyDescription.equals(other.warrantyDescription))
			return false;
		return true;
	}
	
	@Override
	public String toString()
	{
		StringBuilder sb = new StringBuilder();
		
		sb.append("START DATE: ");
		sb.append(warrantyStartDate);
		
		sb.append(SOCConstants.BLANK_STRING);
		sb.append("END DATE: ");
		sb.append(warrantyEndDate);
		
		sb.append(SOCConstants.BLANK_STRING);
		sb.append("PRICE: ");
		sb.append(warrantyPrice);
		
		sb.append(SOCConstants.BLANK_STRING);
		sb.append("SKU: ");
		sb.append(warrantySKU);
		
		sb.append(SOCConstants.BLANK_STRING);
		sb.append("STATUS: ");
		sb.append(warrantyStatus);
		
		sb.append(SOCConstants.BLANK_STRING);
		sb.append("DESCRIPTION: ");
		sb.append(warrantyDescription);
		
		return sb.toString();
	}
	
}
